{extend name="default/template/base_index" /}


{block name="area_header"}
{/block}

{block name="area_body"}
	{include file="default/Widget/topbar" /}
	<div class="admin-main container-fluid">
		{include file="default/Widget/left" /}
		<div class="admin-main-content">
			{include file="default/Widget/breadcrumb" /}
			<div class="alert alert-info">
        注意:点击属性名称设置属性值
      </div>

			<div class="text-center"><h4>{$cate_id ? $cate_name.'类目下的' : '全局'}属性</h4></div>
			<!-- 过滤\查询按钮 -->
				<div class="filter-controls">
				</div>
				<!-- 操作按钮 -->
				<div class="btn-controls">
					<a href="{:url('Category/index')}" class="btn btn-default btn-sm "><i class="fa fa-reply"></i>返回</a>
					<a class="btn btn-primary btn-sm" href="{:url('CategoryProp/add',array('cate_id'=>$cate_id))}"><i class="fa fa-plus"></i>{:L('BTN_ADD')}</a>
					<!--<a target-form="selectitem" class="btn btn-danger btn-sm ajax-post confirm" href="{:url('CategoryProp/bulkDelete')}"><i class="fa fa-trash"></i>{:L('BTN_DELETE')}</a>-->

				</div>

				<table class="table table-striped table table-hover  table-condensed">
					<thead>
						<tr>
							<th>
								<input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');" />
							</th>
							<th>
								属性名称</th>
							<th>
								来源</th>
							<th>
								操作</th>
						</tr>
					</thead>
					<tbody>
						{empty name="list"}
							<tr>
								<td colspan="4" class="text-center">{:L('NO_DATA')}</td>
							</tr>
							{else/}

							{volist name="list" id="vo"}
								<tr>
									<td>
										<input type="checkbox" value="{$vo.id}" name="ids[]" class="selectitem" /></td>
									<td>
										<a href="{:url('CategoryPropvalue/index',array('cate_id'=>$cate_id,'prop_id'=>$vo['id']))}">{$vo.propname}</a></td>
									<td>
										{if condition="$vo['cate_id'] eq $cate_id"}自身
										{elseif condition="$vo['cate_id'] eq $parent" /}上级
										{elseif condition="$vo['cate_id'] eq $root_id" /}上上级
										{else /}上上上级
										{/if}</td>
									<td>
										<!-- 不许编辑 -->
										<!-- <a href="{:url('CategoryProp/edit',array('cate_id'=>$cate_id,'prop_id'=>$vo['id']))}" class="btn btn-sm btn-default"><i class="fa fa-edit"></i>编辑</a> -->
										<a href="{:url('CategoryProp/delete',array('prop_id'=>$vo['id']))}" class="btn btn-sm btn-danger ajax-get confirm"><i class="fa fa-trash"></i>删除</a></td>
								</tr>

							{/volist}
						{/empty}
					</tbody>
				</table>
				<div>{$show}</div>
			</div>

		</div>
		<!-- END admin-main-content -->
	</div>
		<!-- END admin-main-->
{/block}

{block name="area_footer"}

{/block}